package com.xcesys.extras.dataobject;

import java.io.Serializable;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TimestampableObject")
public abstract class TimestampableObject extends AbstractDataObject implements
		Serializable {

	private static final long serialVersionUID = 7395252754257105312L;

	/** time last created. */
	@XmlAttribute(name = "CreatedAt")
	private Date createdAt;

	/** time last modified */
	@XmlAttribute(name = "UpdatedAt")
	private Date updatedAt;

	public TimestampableObject() {
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setCreatedAt(Date createdAt) {
		Object oldValue = this.createdAt;
		this.createdAt = createdAt;
		firePropertyChange("createdAt", oldValue, createdAt);
	}

	public void setUpdatedAt(Date updatedAt) {
		Object oldValue = this.updatedAt;
		this.updatedAt = updatedAt;
		firePropertyChange("updatedAt", oldValue, updatedAt);
	}

}